package com.dynamicallo.ty.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.dynamicallo.ty.dao.ContentMapper;
import com.dynamicallo.ty.entity.Content;

@Service("contentService")
public class ContentServiceImpl implements IContentService{
    @Autowired
    private ContentMapper contentMapper;

    public int addContent(Content content) {
        return contentMapper.insertSelective(content);
    }

    public Content getContentById(int contentId) {
        return contentMapper.selectByPrimaryKey(contentId);
    }

    public int updateContentByIdOrOther(Content content) {
        return contentMapper.updateByPrimaryKeySelective(content);
    }

    public List<Content> getAllContent() {
        return contentMapper.getAllContent();
    }
    
}
